<?php

namespace app\common\validate;

use think\Validate;

class Driver extends Validate
{
    protected $rule = [
        "account" => "require|unique:driver", 
        "nickname" => "require", 
        "password" => "require|min:6",
        "passwords" => "require|confirm:password",
        "mobile" => "require|mobile|unique:driver",
    ];

    protected $message = [
        "account.require" => "请输入账号",    
        "account.unique" => "该账号已经存在",  

        "nickname.require" => "请输入昵称",  

        "password.require" => "请输入密码", 
        "password.min" => "密码必须大于6位数", 
        "passwords.require" => "请重复确认密码",
        "passwords.confirm" => "两次输入的密码不一致",

        "mobile.require" => "手机号不可以为空", 
        "mobile.mobile" => "手机号格式错误", 
        "mobile.unique" => "该手机号已经存在",  

	
    ];

    protected $scene = [
        'add' => ['password','account','nickname'],
        'login' => ['password'],

    ];
}
